package by.amakarevich.datamodel;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import by.amakarevich.datamodel.enums.Artifact;
import by.amakarevich.datamodel.enums.Category;


@Entity
public class Product implements Serializable {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	@Column
	@NotNull
	@Size(max=200)
	private String item;
	
	@Column
	@NotNull
	@Size(max=200)
	private String company;
	
	@Column
	@NotNull
	@Enumerated(EnumType.STRING)
	private Category category;
	
	@Column
	@NotNull
	@Enumerated(EnumType.STRING)
	private Artifact artifact;

	@Column
	@NotNull
	@Min(value=0)
	private Long price;
	
	@Column
	@Max(value=3000)
	private Long available;
	
	@Column
	@Max(value=3000)
	private Long requiredNumber;
	
	@Column
	@Max(value=3000)
	private Long ordered;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getItem() {
		return item;
	}

	public void setItem(String item) {
		this.item = item;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public Artifact getArtifact() {
		return artifact;
	}

	public void setArtifact(Artifact artifact) {
		this.artifact = artifact;
	}


	public Long getPrice() {
		return price;
	}

	public void setPrice(Long price) {
		this.price = price;
	}

	public Long getAvailable() {
		return available;
	}

	public void setAvailable(Long available) {
		this.available = available;
	}

	public Long getRequiredNumber() {
		return requiredNumber;
	}

	public void setRequiredNumber(Long requiredNumber) {
		this.requiredNumber = requiredNumber;
	}

	public Long getOrdered() {
		return ordered;
	}

	public void setOrdered(Long ordered) {
		this.ordered = ordered;
	}
}
